package com.child.java.service.impl;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.child.java.dao.UsersInfoMapper;
import com.child.java.pojo.UsersInfo;
import com.child.java.service.UsersInfoService;

@Service
public class UsersInfoServiceImpl implements UsersInfoService {
	
	@Autowired
	private UsersInfoMapper usersInfoMapper;
	@Override
	public UsersInfo getByName(String username) {
		return usersInfoMapper.getByName(username);
	}

	@Override
	public void insert(UsersInfo userInfo) {
		userInfo.setId(UUID.randomUUID().toString());
		usersInfoMapper.insert(userInfo);
	}

	@Override
	public UsersInfo getByNameAndPwd(String username, String password) {
		return usersInfoMapper.getByNameAndPwd(username, password);
	}

	@Override
	public UsersInfo getById(String userid) {
		return usersInfoMapper.getById(userid);
	}

}
